package com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.singleModel;

/**
 * 杭州惟君医疗科技有限公司17
 * Created by 20433 on 2018/4/28
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易------------------------------> 双重锁式 单例模式
 */

public class singleton {
    private static volatile singleton instance = null;

    private singleton() {}

    public static singleton getInstance(){
        if(instance == null){
            synchronized (singleton.class){
                if(instance == null){
                    instance = new singleton();
                }
            }
        }
        return instance;
    }
}
